package com.itcam.cm.user.controller;


import com.itcam.cm.model.dto.user.UserLoginDto;
import com.itcam.cm.model.dto.user.UserRegisterDto;
import com.itcam.cm.model.entity.user.AuthContextUtil;
import com.itcam.cm.model.entity.user.UserAddress;
import com.itcam.cm.model.entity.user.UserInfo;
import com.itcam.cm.model.vo.common.Result;
import com.itcam.cm.model.vo.user.UserInfoVo;
import com.itcam.cm.user.service.UserAddressService;
import com.itcam.cm.user.service.UserInfoService;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/api/user/userAddress")
@RestController
public class UserAddressController {

    @Autowired
    UserAddressService userAddressService;

    @GetMapping("auth/findUserAddressList")
    public Result<List<UserAddress>> findUserAddressList() {
        List<UserAddress> list = userAddressService.findUserAddressList();
        return Result.ok(list) ;
    }

    @GetMapping("auth/getUserAddress/{userAddressId}")
    UserAddress getUserAddress(@PathVariable Long userAddressId){
        return userAddressService.getUserAddress(userAddressId);
    }



}
